package com.work.vo.transport;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.Func;

/**
 * 货名VO
 *
 * @author ：dujianyu
 * @since ：Created in 2024/5/6 14:28
 */
@Data
public class CargoTypeVO {

    @ApiModelProperty(value = "代码")
    private String code;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "名称")
    private String pinyinHead;

    @ApiModelProperty(value = "带拼音名称")
    private String nameWithPinyin;

    public String getNameWithPinyin() {
        if (Func.isNull(pinyinHead)) {
            return name;
        }
        return name + "(" + pinyinHead + ")";
    }
}
